Exemplary embodiments of the present invention relate to structured software documents, and more particularly, to performing three-way merge operations on such documents.
Version control refers to the management of different versions and variants of data files and software. As software is developed, designed, and deployed, it is extremely common for multiple states, or versions, of the same software to be deployed in different sites, as well as for the software's developers to be working simultaneously on updates. Code reuse, which refers to the use of existing software to update software or implement new software, is based on the idea that a partial or complete computer program written at one time can be, should be, or is being used in another program written at a later time. Programmers have reused sections of code, templates, functions, and procedures from the earliest days of programming to save time and energy by reducing redundant development work. The most common type of reuse of is the reuse of software components, but other artifacts produced during the software development process such as system architecture, analysis models, design models, design patterns, database schemas, web services can also be reused. The general development practice of using a prior version of an extant program as a starting point for the next version is a standard form of code reuse.
A more typical example of code reuse is the topic of end-user development (EUD), which refers to activities or techniques that allow people who are not professional developers to create or modify a software artifact. EUD may be viewed as essentially out-sourcing the development effort to the end user. A common instance of EUD is programming to extend and adapt an existing application package (for example, an office suite). Two main reasons why EUD has become popular are because organizations can use EUD to effectively cut the time of completion on a project and because software tools are more powerful and easier to use. A drawback with the implementation of EUD, however, is that it can increase the complexity of software maintenance, which generally involves the modification of a software product after delivery to correct faults, to improve performance or other attributes, or to adapt the product to a modified environment. In particular, where an end-user has made individual customizations to programming code, it is difficult for the original developer of that code to account for these customizations in considering the processes of implementation and product acceptance for the maintenance modifications.
Three-way merging refers to techniques employed for reintegrating changes made in parallel to multiple independently modified copies of a base software artifact into a single, unified copy of the software artifact containing the changes. As an integral part of performing a three-way merge, the edits made between a base document of the software artifact and modified versions of the document are first detected so that the modifications made can be merged into the unified version. The existing solutions and tools for performing a three-way merge such as, for example, diff, patch, and Eclipse Compare, consider the structure of its input documents (that is, the base document and the modified documents) to be an ordered list of text lines. When used with structured documents, however, these existing merge solutions are difficult to use and not useful for preventing inconsistencies when performing the merge without requiring a user to read the content of the documents to determine the differences. The existing solutions, for example, are not able to address situations where order is important for some elements in a document but not important for other elements in the document, situations where elements are moved within a document or to another document within the software artifact, or situations where a complex semantic structure of the software code must be taken into consideration to perform a successful merge.